package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhAfterFactoryBalanceMapper;
import com.ruoyi.zsyh.domain.ZsyhAfterFactoryBalance;
import com.ruoyi.zsyh.service.IZsyhAfterFactoryBalanceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 售后厂家账户变动Service业务层处理
 * 
 * @author yuexl
 * @date 2022-08-22
 */
@Service
public class ZsyhAfterFactoryBalanceServiceImpl implements IZsyhAfterFactoryBalanceService 
{
    @Autowired
    private ZsyhAfterFactoryBalanceMapper zsyhAfterFactoryBalanceMapper;

    /**
     * 查询售后厂家账户变动
     * 
     * @param id 售后厂家账户变动ID
     * @return 售后厂家账户变动
     */
    @Override
    public ZsyhAfterFactoryBalance selectZsyhAfterFactoryBalanceById(Long id)
    {
        return zsyhAfterFactoryBalanceMapper.selectZsyhAfterFactoryBalanceById(id);
    }

    public ZsyhAfterFactoryBalance selectZsyhAfterFactoryBalanceByBalanceRechargeState(String balanceRechargeState){
        return zsyhAfterFactoryBalanceMapper.selectZsyhAfterFactoryBalanceByBalanceRechargeState(balanceRechargeState);
    }

    /**
     * 查询售后厂家账户变动列表
     * 
     * @param zsyhAfterFactoryBalance 售后厂家账户变动
     * @return 售后厂家账户变动
     */
    @Override
    public List<ZsyhAfterFactoryBalance> selectZsyhAfterFactoryBalanceList(ZsyhAfterFactoryBalance zsyhAfterFactoryBalance)
    {
        return zsyhAfterFactoryBalanceMapper.selectZsyhAfterFactoryBalanceList(zsyhAfterFactoryBalance);
    }

    /**
     * 新增售后厂家账户变动
     * 
     * @param zsyhAfterFactoryBalance 售后厂家账户变动
     * @return 结果
     */
    @Override
    public int insertZsyhAfterFactoryBalance(ZsyhAfterFactoryBalance zsyhAfterFactoryBalance)
    {
        zsyhAfterFactoryBalance.setCreateTime(DateUtils.getNowDate());
        return zsyhAfterFactoryBalanceMapper.insertZsyhAfterFactoryBalance(zsyhAfterFactoryBalance);
    }

    /**
     * 修改售后厂家账户变动
     * 
     * @param zsyhAfterFactoryBalance 售后厂家账户变动
     * @return 结果
     */
    @Override
    public int updateZsyhAfterFactoryBalance(ZsyhAfterFactoryBalance zsyhAfterFactoryBalance)
    {
        return zsyhAfterFactoryBalanceMapper.updateZsyhAfterFactoryBalance(zsyhAfterFactoryBalance);
    }

    /**
     * 删除售后厂家账户变动对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhAfterFactoryBalanceByIds(String ids)
    {
        return zsyhAfterFactoryBalanceMapper.deleteZsyhAfterFactoryBalanceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除售后厂家账户变动信息
     * 
     * @param id 售后厂家账户变动ID
     * @return 结果
     */
    @Override
    public int deleteZsyhAfterFactoryBalanceById(Long id)
    {
        return zsyhAfterFactoryBalanceMapper.deleteZsyhAfterFactoryBalanceById(id);
    }
}
